<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button class="btn">添加cookie</button>
    <button class="de">删除cookie</button>

    <script src="/day1/js/getdelete.js"></script>
    <script>
        var btn=document.querySelector('.btn')
        var de=document.querySelector('.de')
        
        btn.onclick=function(){
            setCookie("user1","sss")
            console.log(1)
        }
        de.onclick=function(){
            console.log(getCookie("user1"))
            deCookie("user1")
        }
    </script>
</body>
</html>